package com.tool.test;

import java.util.StringJoiner;

public class ArrayUtil {
    private ArrayUtil(){}

    public static String printArr(int[] number){
        StringJoiner sj=new StringJoiner(",","[","]");
        for (int i = 0; i < number.length; i++) {
            sj.add(number[i]+"");
        }
        String s=sj.toString();
        return s;
    }
    public static double getAverage(double[] number){
        double sum=0;
        for (int i = 0; i < number.length; i++) {
            sum=sum+number[i];
        }
        double average=sum/ number.length;
        return average;
    }
}
